{% autoescape on %}
  {% with person.identity_set|first as first_identity %}
    {% if person.historical %}
    	<a href="/public/view_person?proto={{proto|urlencode}}" class="person">person {{first_identity.name}}</a>
    {% else %}
    	<a href="/public/view_person?key={{person.key|urlencode}}" class="person">person {{first_identity.name}}</a>
    {% endif %}
  {% endwith %}
{% endautoescape %}
